<!-- 搜索表单 -->
<template>
  <ele-card :body-style="{ paddingBottom: '2px' }">
    <el-form label-width="72px" @keyup.enter="search" inline>
      <el-form-item label="状态">
        <el-radio-group v-model="form.rebate_status" @change="search">
          <el-radio-button :value="0">待收款</el-radio-button>
          <el-radio-button :value="200">已收</el-radio-button>
        </el-radio-group>
      </el-form-item>
      <br />
      <el-form-item label="业务员">
        <el-input v-model.trim="form.insurance_salesman" />
      </el-form-item>
      <el-form-item label="保险公司">
        <el-input v-model.trim="form.insurance" />
      </el-form-item>

      <el-form-item label-width="16px">
        <el-button type="primary" @click="search">查询</el-button>
      </el-form-item>
    </el-form>
  </ele-card>
</template>

<script setup>
  import { useFormData } from '@/utils/use-form-data';

  const emit = defineEmits(['search']);

  /** 表单数据 */
  const [form] = useFormData({
    insurance_salesman: '',
    insurance: '',
    company: '',
    area_id: 0,
    plate_number: '',
    rebate_status: 0
  });

  /** 搜索 */
  const search = () => {
    console.log(form);
    emit('search', { ...form });
  };
</script>
